<?php ob_start(); ?>
<?php
echo $this->Html->css(array('/aih/Aihre.css',));
?>
<style>
    #wrapper {
        height: auto;
        margin: auto;
        width: 1024px;
    }
    .wrapper-body {
        background-color: White;
        height: auto;
        margin: 0;
        padding: 10px 0 0;
        width: 100%;
    }
    .wrapper-content-body {
        background-color: White;
        height: auto;
        margin: 0 0 60px;
        padding: 0 16px 0;
        width: 96.8%;
    }
    .title-body-content {
        color: #A0002A;
        font-size: 17px;
        font-weight: bold;
        height: auto;
        margin: 0 0 0;
        padding: 0;
        text-align: center;
        width: 100%;
    }
    .span-tbl-payment{
        display: inline-block;
        margin: 0;
        width: 100%;
    }
</style>
<div class="header clearfix">
    <div class="head-logo">
        <?php echo $this->Html->image('/img/aih/ARBL FULL Logo Letterhead Footer JPG r.jpg'); ?>
    </div>
    <!-- HTML for menu-bottom-header-->
</div>
<div class="wrapper-body clearfix">
    <div class="wrapper-content-body clearfix">
        <div class="title-body-content" style="margin-top: 30px; margin-bottom: 30px;"><?php echo $title_for_layout; ?></div>
        <div class="wrapper-form-account-resume clearfix">
            <div class="wrapper-date clearfix">
                <table style="margin-top: 15px;" cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Date'); ?> :</span>
                        </td>
                        <td>
                            <span><?php echo date('m/d/Y', strtotime($this->data['Accountresume']['date'])); ?></span>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrapper-reference-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Reference #'); ?> :</span>
                        </td>
                        <td>
                            <span><?php echo $this->data['Accountresume']['refid_edit']; ?></span>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrapper-producing-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Producer'); ?> :</span>
                        </td>
                        <td>
                            <?php
                            foreach ($cur_data_producing_brokers as $key => $value) {
                                echo '<div class="contactField" style="text-align:left">';
                                echo '   <span class="size-span" style="width: 260px; float:left">';
                                echo $value;
                                echo '       <input type="hidden" name="Producingbrokers[]" value="' . $key . '" />';
                                echo '   </span>';
                                echo '   <span style="float:right; font-weight:bold"></span>';
                                echo '</div>';
                            }
                            ?>
                            <span id="Producingbroker"></span>
                        </td>
                    </tr>
                </table>
            </div>

            <div class="wrapper-rein-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Reinsured'); ?> :</span>
                        </td>
                        <td>
                            <span><?php echo $this->data['Accountresume']['reinsured']; ?></span>
                        </td>
                    </tr>
                </table>
            </div>

            <div class="wrapper-ori-insurer-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Original Insured'); ?> :</span>
                        </td>
                        <td>
                            <span><?php echo $this->data['Accountresume']['original_insured']; ?></span>
                        </td>
                    </tr>
                </table>
            </div>

            <div class="wrapper-ori-insurer-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Markets'); ?> :</span>
                        </td>
                        <td>
                            <?php
                            foreach ($cur_data_markets as $key => $value) {
                                echo '<div id="marketField' . $key . '" class="marketField" style="text-align:left">';
                                echo '   <span class="size-span" style="width: 260px; float:left">';
                                echo $value;
                                echo '       <input type="hidden" name="Markets[]" value="' . $key . '" />';
                                echo '   </span>';
                                echo '   <span style="float:right; font-weight:bold"></span>';
                                echo '</div>';
                            }
                            ?>
                            <span id="Market"></span>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrapper-insurance-type-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Insurance Type'); ?> :</span>
                        </td>
                        <td>
                            <span><?php echo $insurancetypes; ?></span>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrapper-insurance-type-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Insurance Type Detail'); ?> :</span>
                        </td>
                        <td>
                            <span><?php echo $this->data['Accountresume']['insurancetype_detail']; ?></span>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrapper-insurance-period-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Insurance Period'); ?> :</span>
                        </td>
                        <td>
                            <span><?php echo date('m/d/Y', strtotime($this->data['Accountresume']['from_date'])); ?></span>
                            <span style="margin-left: 10px; margin-right: 10px;"><?php echo __('To'); ?></span>
                            <span><?php echo date('m/d/Y', strtotime($this->data['Accountresume']['to_date'])); ?></span>
                            <span style="margin-left: 40px;">
                                <?php echo __('Total day'); ?> : <span id="total_days"><?php echo $this->request->data['Accountresume']['total_days']; ?></span>
                            </span>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrapper-sum-insured-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Sum Insured'); ?> :</span>
                        </td>
                        <td>
                            <span class="inp-sum-insured" style="width:350px" name="sum_insured">
                                <?php echo number_format($this->request->data['Accountresume']['sum_insured'], 2); ?>
                            </span>
                            <span><?php echo $this->data['Accountresume']['currency']; ?></span>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrapper-rate-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Rate'); ?> :</span>
                        </td>
                        <td>
                            <span><?php echo $this->data['Accountresume']['rate'] . ' %'; ?></span>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrapper-gross-pre-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Gross Premium'); ?> :</span>
                        </td>
                        <td>
                            <span id="Gross_Premium"><?php echo number_format($this->data['Accountresume']['gross_premium'], 2); ?></span> 
                            <span class="selected_currency"><?php echo $this->data['Accountresume']['currency']; ?></span> 
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrapper-rate-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Order Hereon'); ?> :</span>
                        </td>
                        <td>
                            <span><?php echo $this->data['Accountresume']['order_hereon'] . ' %'; ?></span>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrapper-gross-pre-page4 clearfix">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td style="text-align:left; width:200px; vertical-align:top">
                            <span class="size-span"><?php echo __('Nett Premium'); ?> :</span>
                        </td>
                        <td>
                            <span id="Nett_Premium"><?php echo number_format($this->data['Accountresume']['nett_premium'], 2); ?></span> 
                <span class="selected_currency"><?php echo $this->data['Accountresume']['currency']; ?></span>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrapper-placement-detail clearfix" style="margin-top: 30px;">
                <span class="title-placement-detail"><?php echo __('PLACEMENT DETAILS'); ?></span>
                <?php
                foreach ($placementdetails as $placementdetail) {
                    echo $this->Layout->placementDetailField_pdf($cur_data_market_full_repair[$placementdetail['Placementdetailt']['contact_id']]['Market'], $placementdetail['Placementdetailt'], true);
                }
                ?>
                <span id="placementdetailField"></span>
            </div>
            <div class="wrapper-payment-schedule clearfix" style="margin-top: 30px;">
                <span class="title-payment-schedule"><?php echo __('PAYMENT SCHEDULE'); ?></span>
                <div class="wrapper-content-payment-schedule clearfix">
                    <?php
                    foreach ($paymentschedules as $paymentschedule) {
                        echo $this->Layout->paymentscheduleField_pdf($paymentschedule['Paymentschedule'], $paymentschedule['Paymentschedule']['payer'], $paymentschedule['Paymentschedule']['payer_name'], $cur_data_market_full, true);
                    }
                    ?>
                    <span id="paymentscheduleField"></span>
                </div>
            </div>
        </div>
    </div>
</div>
<?php
$HtmlCode = ob_get_contents();
ob_end_flush();
$HtmlCode1 = str_replace('/aih/img/aih/ARBL FULL Logo Letterhead Footer JPG r.jpg', 'img/ARBL FULL Logo Letterhead Footer JPG r.jpg', $HtmlCode);
$file = '/home/johnso28/public_html/aihreinsurance.com/dompdf/aih/account_resume.html';
file_put_contents($file, $HtmlCode1);
?>
<div class="wrapper-button-form" style="margin-bottom: 10px;">
    <div class="button-form">
        <div class="button-aihre button-blue">
            <a href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/dompdf/dompdf.php?base_path=aih/&input_file=account_resume.html&paper=a4">Download PDF</a>
        </div>
    </div>
</div>